package com.yituo.controller;

import com.github.pagehelper.PageInfo;
import com.yituo.service.DeptService;
import com.yituo.vo.Dept;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@Controller
@CrossOrigin(origins = "*")
public class DeptController {
    @Autowired
    DeptService deptService;
    @RequestMapping("queryAllDept/{pageNum}/{size}")
    @ResponseBody
    public List<Dept> queryAllDept(@PathVariable("pageNum") int pageNum, @PathVariable("size") int size){
        System.out.println(pageNum+"------"+size);
        return deptService.queryAllDept(pageNum,size).getList();
    }

}
